﻿using System.Linq;
using System.Data.Objects;

namespace OnlineFamilyCalendar.Data
{
    public static class ExtensionMethods
    {
        public static IQueryable<TSource> Include<TSource>(this IQueryable<TSource> source, string path)
        {
            var objectQuery = source as ObjectQuery<TSource>;
            if (objectQuery != null)
            {
                return objectQuery.Include(path);
            }
            return source;
        }
    }    
}
